#define _CRT_SECURE_NO_WARNINGS 1
#include "List.h"

void Test1()
{
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	printList(plist);
	ListPopBack(plist);
	ListPopBack(plist);
	printList(plist);
}

void Test2()
{
	LTNode* plist = ListInit();
	/*ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	printList(plist);*/
	ListPushFront(plist, 0);
	ListPushFront(plist, -1);
	ListPushFront(plist, -2);
	printList(plist);
	ListPopFront(plist);
	printList(plist);
	ListPopFront(plist);
	printList(plist);
}

void Test3()
{
	LTNode* plist = ListInit();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	printList(plist);
	LTNode* pos = getNodePos(plist, 3);
	ListInsert(pos, 0);
	printList(plist);
	pos = getNodePos(plist, 0);
	ListErase(pos);
	printList(plist);
	ListDestroy(plist);
	plist = NULL;
}

int main()
{
	//Test1();
	//Test2();
	Test3();

	return 0;
}